import { axios } from '~/plugins/axios';

// 工作台 - 获取工作台基本信息
export const getCurrentInfo = (params?: any) => axios({
  method: 'get',
  url: '/UserController/current_info',
  params,
}) as Promise<any>;

// 工作台 - 便捷导航 （管理者
export const getNavList = (params?: any) => axios({
  method: 'get',
  url: '/admin/navigationList',
  params,
}) as Promise<any>;

// 工作台 - 关注项目 （投资人）
export const getStaredOrg = (params?: any) => axios({
  method: 'get',
  url: '/org/staredOrg',
  params,
}) as Promise<any>;

// 工作台 - 可能感兴趣的项目 （投资人）
export const getInterestedProject = (params?: any) => axios({
  method: 'get',
  url: '/UserController/interestedProject',
  params,
}) as Promise<any>;

// 工作台 - 推荐案例 （投资人）
export const getRecommendCase = (params?: any) => axios({
  method: 'get',
  url: '/UserController/recommendCase',
  params,
}) as Promise<any>;

// 站内信列表
export const getMessagesList = (params?: any) => axios({
  method: 'get',
  url: '/message/inside_letter',
  params,
}) as Promise<any>;

// 系统通知列表
export const getNotificationList = (params?: any) => axios({
  method: 'get',
  url: '/message/system_notification',
  params,
}) as Promise<any>;

// 根据id读取站内信
export const getMessages = (params: any) => axios({
  method: 'get',
  url: `/message/${params as string}`,
}) as Promise<any>;

// 用户发送站内信
export const sendMessage = (params: any) => axios({
  method: 'post',
  url: '/message/send_message',
  data: params,
}) as Promise<any>;

// 根据id删除站内信,可删除多条
export const deleteMessages = (params: any) => axios({
  method: 'delete',
  url: `/message/${params as string}`,
}) as Promise<any>;

// 根据ids设置已读,支持批量设置
export const readMark = (params: any) => axios({
  method: 'post',
  url: '/message/read_mark',
  data: params,
}) as Promise<any>;

// 个人资料修改
export const updateInfo = (params: any) => axios({
  method: 'post',
  url: '/UserController/updateInfo',
  data: params,
}) as Promise<any>;

// 简单检测是否有未读的系统消息
export const checkMsg = () => axios({
  method: 'get',
  url: '/action/check_msg',
}) as Promise<any>;

// 项目分布统计
export const projectStatistics = () => axios({
  method: 'get',
  url: '/UserController/projectStatistics',
}) as Promise<any>;

// 机构统计
export const orgStatistics = () => axios({
  method: 'get',
  url: '/UserController/orgStatistics',
}) as Promise<any>;
